def main():
    magic_square=int(input())
    if magic_square==1:

        print(1)
    else:
        magic_matrix=[[0]*magic_square for i in range(magic_square)]
        mid = magic_square//2
        x_pre,y_pre=0,mid
        magic_matrix[x_pre][y_pre]=1
        for k in range(2, magic_square * magic_square + 1):
            if x_pre == 0 and y_pre != magic_square - 1:
               x, y = magic_square - 1, y_pre + 1
            elif y_pre == magic_square - 1 and x_pre != 0:
               x, y = x_pre - 1, 0
            elif x_pre == 0 and y_pre == magic_square - 1:
               x, y = x_pre + 1, y_pre
            else:
               x_test = x_pre - 1
               y_test = y_pre + 1
               if magic_matrix[x_test][y_test] == 0:
                   x, y = x_test, y_test
               else:
                   x, y = x_pre + 1, y_pre
            magic_matrix[x][y] = k
            x_pre, y_pre = x, y
        for row in magic_matrix:
            print(' '.join(map(str,row)))
main()